<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>登录 - ${_SITE_NAME}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">

<link href="${_BASE_PATH}/assets/bootstrap/css/bootstrap.min.css"
	rel="stylesheet">
<link
	href="${_BASE_PATH}/assets/bootstrap/css/bootstrap-responsive.min.css"
	rel="stylesheet">


<script type="text/javascript"
	src="${_BASE_PATH}/assets/jquery/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="${_BASE_PATH}/assets/utils.js"></script>
<script type="text/javascript"
	src="${_BASE_PATH}/assets/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript"
	src="${_BASE_PATH}/assets/bootstrap/js/bootstrap-validation.js"></script>

</head>
<body>
	<div class="hero-unit">
		<h1>${_SITE_NAME}</h1>
		<p>${_SITE_NAME} 已经完全重新设计, 让你更轻松地处理与管理你的工作。</p>
		<div class="row-fluid">
			<div class="span6">
				<form class="form-horizontal" id="loginForm">
					<div class="control-group">
						<label class="control-label">用户名</label>
						<div class="controls">
							<input name="username_" type="text" placeholder="请输入用户名"
								check-type="required">
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">密码</label>
						<div class="controls">
							<input name="password_" type="password" placeholder="请输入密码"
								check-type="required">
						</div>
					</div>
					<div class="control-group">
						<div class="controls">
							<button id="loginBtn" class="btn btn-primary">登录</button>
							<button type="reset" class="btn">重置</button>
						</div>
					</div>

				</form>
			</div>
			<div class="span6">
				<div id="msg"></div>
			</div>
		</div>

	</div>
</body>
</html>
<script type="text/javascript">
	$("#loginBtn").click(function(e) {
		$("#msg").removeClass("alert alert-error").html("");
		var params = AKF.formParams($("#loginForm"));
		if ($('#loginForm').validation()) {
			$.ajax({
				url : "${_BASE_PATH}/doLogin",
				data : params,
				success : function(result) {
					if(result.msg != ""){
						$("#msg").addClass("alert alert-error").html(result.msg);
					}else{
						window.location.href = "${_BASE_PATH}/frame"
					}
				}
			});
		}
		e.preventDefault();
	});
</script>